import { defineStore } from 'pinia'

export const useAnalysisStore = defineStore('analysis', {
  state: () => ({
    videoRank: [],
    tabRank: [],
    userFlavor: [],
    exportData: null
  }),
  actions: {
    setAnalysisData(data) {
      this.videoRank = data.videoRank
      this.tabRank = data.tabRank
      this.userFlavor = data.userFlavor
    },
    setExportData(data) {
      this.exportData = data
    },
    getExportData() {
      return this.exportData
    },
    clearAnalysisData() {
      this.videoRank = []
      this.tabRank = []
      this.userFlavor = []
      this.exportData = null
    }
  },
  persist: true
}) 